package start.service.impls;

import org.springframework.stereotype.Service;
import start.mapper.StreetMapper;
import start.model.Street;
import start.service.IStreetService;

import javax.annotation.Resource;
import java.util.List;

@Service
public class StreetService implements IStreetService {
	@Resource
	private StreetMapper mapper;
	@Override
	public void save(Street bean) {
		if(bean.getId()!=null&&bean.getId()>0) {
			this.mapper.update(bean);
		}else {
			this.mapper.insert(bean);
		}

	}

	@Override
	public void remove(int id) {
		this.mapper.delete(id);

	}

	@Override
	public List<Street> findAll(String cycode) {
		
		return this.mapper.selectAll(cycode);
	}

}
